import re


def convert(value):
    matched = value.group()
    return '!!'+matched+'!!'


# 查找并替换
language = 'PythonC#\nJavaPhpPython'

# r = re.sub('Python', 'haha', language)
r = re.sub('Python', convert, language)
print(r)
